#ifndef FIFOCONNECTOR_H
#define FIFOCONNECTOR_H

#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include    "mTimer.h"
#include   "message_fifo.h"

#define HEARTBEAT 0
#define SYS_STATUS 1
#define GPS_RAW_INT 24
#define ATTITUDE 30
#define GLOBAL_POSITION_INT 33
#define VFR_HUD 74
#define PARAM_VALUE 22
#define MISSION_REQUEST 40
#define MISSION_COUNT 44
#define MISSION_ACK 47
#define MISSION_ITEM 39
#define COMMAND_ACK 77
#define STATE_SP 190
#define STATUSTEXT 253

#define MaxFifo 256
#define MaxMap  256

class Message_FIFO_WR_T;
class Message_FIFO_WR_T_Aperiodic;
class mTimer;
struct  IntervalMap
{
    int     msgID;
    int interval;
};
class FiFoConnector
{
public:
    FiFoConnector();
    ~FiFoConnector();
   void ArgMavConn(mavlink_message_t msg,int msgId,Mes_Time message_time);
   void AddToTimeMap(int msgID,int interval);
   void addFifo(Message_FIFO_WR_T *fifo);

private:
    Message_FIFO_WR_T * getFifo(int msgID);
    int getInerval(int msgID);
    Message_FIFO_WR_T* fifoList[MaxFifo];
    int fifoConter;
    IntervalMap  Imap[MaxMap];
    int  mapCouter;
    mTimer * timer;
    BufferType* bufferType;
};

#endif // FIFOCONNECTOR_H
